﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DevicesView.Model.ViewData
{

    public class ViewCMD : INotifyPropertyChanged
    {


        public ViewCMD()
        {

        }
        public ViewCMD(Devices.Command cmd)
        {
            Id = cmd.Id;
            PetName = cmd.PetName;
            Name = cmd.Name;
            Date = cmd.Date;
            statusString = cmd.StatusString;
            Command = cmd;
            Result = cmd.Result;
        }

        public ViewCMD(Devices.Result result)
        {
            Id = result.CMD.Id;
            PetName = result.CMD.PetName;
            Name = result.CMD.Name;
            Date = result.CMD.Date;
            statusString = result.CMD.StatusString;
            Command = result.CMD;
            Result = result;
        }


        private string id { get; set; }
        private string petName { get; set; }

        private string name { get; set; }

        private DateTime date { get; set; }
        private string statusString { get; set; }

  





        public string Id
        {
            get { return id; }
            set {
                id = value;
                PropertyChanged?.Invoke(value,new PropertyChangedEventArgs("Id"));
            }
        }
        public string PetName
        {
            get { return petName; }
            set
            {
                petName = value;
                PropertyChanged?.Invoke(value, new PropertyChangedEventArgs("PetName"));
            }
        }

        public string Name
        {
            get { return name; }
            set
            {
                name = value;
                PropertyChanged?.Invoke(value, new PropertyChangedEventArgs("Name"));
            }
        }

        public DateTime Date
        {
            get { return date; }
            set
            {
                date = value;
                PropertyChanged?.Invoke(value, new PropertyChangedEventArgs("Date"));
            }
        }
        public string StatusString
        {
            get { return statusString; }
            set
            {
                statusString = value;
                PropertyChanged?.Invoke(value, new PropertyChangedEventArgs("StatusString"));
            }
        }

        public Devices.Command Command { get; set; }
        public Devices.Result Result { get; set; }
        public event PropertyChangedEventHandler PropertyChanged;
    }
}
